<template>
    <div v-show="item.role === 'bot'">
        <div v-show="item.loading === true" class="left_content">
            <a-icon type="loading" />
        </div>
        <div v-show="item.loading !== true">
            <div style="display: flex;align-items: center;">
            <div class="left_content">
                <span :key="index.id" v-for="(text, index) in item.texts">
                    {{ text }}
                </span>
            </div>
            <div v-if="item.atlas" style="margin-left: 8px;">
                <a @click="foldRightDemo"> 知识图谱 <a-icon type="double-right" /></a>
            </div>
        </div>
        <div class="left_tip" v-if="item.guess">
            <a>猜你想问</a>
            <a-space style="display: flex; flex-wrap: wrap;">
                <div v-for="(text) in item.guess" :key="text" class="tip_tag" style="margin-bottom: 0px;"
                    @click="ChildSubmit('tip', text)">
                    {{ text }}
                </div>
            </a-space>
        </div>
        </div>
    </div>
</template>

<script>
import { mapState } from "vuex";
export default {
    props: {
        Submit: {},
        item: {}
    },
    methods: {
        ChildSubmit(type, text) {
            this.Submit(type, text);
        },
        foldRightDemo() {
            this.$store.commit("setRightHidden");
        }
    },
    computed: {
        ...mapState([
            "setRightHidden",
        ]),
    },
};
</script>

<style lang="less" scoped>
.left_content {
    background-color: white;
    border-radius: 4px;
    text-align: start;
    padding: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0px 0px 6px rgba(15, 15, 52, 0.17);
    word-break: break-all;
    width: max-content;
}

.left_tip {
    display: flex;
    align-items: center;
    margin-top: 8px;

    a {
        margin-right: 12px;
    }

}

.tip_tag {
    background: #f5f8ff;
    border-radius: 4px;
    white-space: nowrap;
    padding: 16px 22px;
    margin-bottom: 14px;
}
</style>